<?php
/**
 * The loop that displays a single post.
 *
 * The loop displays the posts and the post content.  See
 * http://codex.wordpress.org/The_Loop to understand it and
 * http://codex.wordpress.org/Template_Tags to understand
 * the tags used in it.
 *
 * This can be overridden in child themes with loop-single.php.
 *
 * @package toekneestuck
 * @subpackage toekneestuck
 * @since toekneestuck 2.0
 */

if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
	<header>
		<?php if( count( get_the_category()) && get_post_format() != 'aside' ): ?><h6 class="meta-category"><span class="cat-links"><?php echo get_the_category_list( ', ' ); ?></span></h6><?php endif; ?>
		<h1><?php the_title(); ?></h1>
		<p class="entry-meta">
		<?php toeknee_the_date(); ?><?php $tags_list = get_the_tag_list( '', ', ' );
				if ( $tags_list ): ?>
		&bull; <span class="tag-links"><?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'toeknee' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?></span><?php endif; ?>
		<?php edit_post_link( __( 'Edit', 'toeknee' ), ' &bull; <span class="edit-link">', '</span>' ); ?>
	</p><!-- .entry-meta -->
	</header>

	<div class="entry-content">
		<?php if( has_post_thumbnail() ) the_post_thumbnail('post-thumbnail', array('class' => 'right')) ?>
		<?php the_content(); ?>
		<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'toeknee' ), 'after' => '</div>' ) ); ?>
	</div><!-- .entry-content -->

<?php if ( get_the_author_meta( 'description' ) && get_post_format() != 'aside' ): ?>
	<div id="entry-author-info" class="clearfix dark">
		<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'toeknee_author_bio_avatar_size', 60 ) ); ?>
		<div id="author-description">
			<h4><?php printf( esc_attr__( 'About me, %s', 'toeknee' ), get_the_author() ); ?></h4>
			<p><?php echo nl2br( get_the_author_meta( 'description' ) ); ?></p>
		</div><!-- #author-description -->
	</div><!-- #entry-author-info -->
<?php endif; ?>
</article><!-- #post-## -->

<div id="nav-below" class="navigation clearfix">
	<div class="nav-previous left cbtn"><?php previous_post_link( '%link', 'Prev Post' ); ?></div>
	<div class="nav-next right cbtn"><?php next_post_link( '%link', 'Next Post' ); ?></div>
</div><!-- /#nav-below -->
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>